/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background-color: #f4f4f9;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 滚动幻灯片 */
.slider {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    /* 减小幻灯片底部外边距 */
    margin-bottom: 15px; 
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.slides {
    display: flex;
    width: 300%;
    height: 100%;
    transition: transform 0.5s ease;
}

.slides img {
    width: 33.3333%;
    height: 100%;
    object-fit: cover;
}

/* 显示首页商品列表 */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* 商品分类 */
.product-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 20px;
    background-color: white;
    margin-bottom: 15px; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-btn {
    padding: 8px 16px;
    border: 1px solid #007BFF;
    background-color: white;
    color: #007BFF;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.category-btn.active {
    background-color: #007BFF;
    color: white;
}

.category-btn:hover {
    background-color: #0056b3;
    color: white;
    border-color: #0056b3;
}

/* 商品项 */
.product {
    background-color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.product img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-info h3 {
    margin-bottom: 5px;
    color: #333;
    font-size: 1.1em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-info p {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9em;
}

/* 商品操作按钮 */
.product-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    margin: 0;
}

.quantity-control button {
    padding: 6px 10px;
    font-size: 14px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.quantity-control button:hover {
    background-color: #0056b3;
}

.quantity-control input {
    width: 40px;
    text-align: center;
    margin: 0 6px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.add-to-cart {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.add-to-cart:hover {
    background-color: #218838;
}

/* 购物车页面 */
.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    border: 1px solid #ccc;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-total {
    text-align: right;
}

#checkout {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
}

/* 用户中心页面 */
.user-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 20px;
}

.user-section h2 {
    margin-bottom: 10px;
}

/* 底部导航 */
.bottom-nav {
    background-color: #333;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    /* 固定在底部 */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 12px;
}

.bottom-nav a img {
    width: 24px;
    height: 24px;
    margin-bottom: 5px;
}

/* 调整订单列表区域的内边距，为底部导航留出空间 */
.order-list-area {
    padding: 60px 20px 80px; /* 顶部 60px 为头部留出空间，底部 80px 为底部导航留出空间 */
    max-height: calc(100vh - 140px); /* 减去头部和底部导航的高度 */
    overflow-y: auto;
}

main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    /* 为固定底部导航留出空间 */
    padding-bottom: 60px; 
}

/* 购物车页面样式 */
body {
    background-color: #f4f4f9;
    padding-top: 60px; /* 为固定头部留出空间 */
    padding-bottom: 80px; /* 为固定底部留出空间 */
}

/* 头部 */
.cart-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #000;
    color: white;
    display: flex;
    align-items: center;
    /* 减小上下内边距以降低头部高度 */
    padding: 10px 20px; 
    z-index: 1000;
}

.cart-header a {
    margin-right: 20px;
}

.cart-header .back-symbol {
    font-size: 24px;
    color: white; /* 设置返回符号颜色为白色 */
    display: inline-block;
    cursor: pointer;
    transition: color 0.3s ease;
}

.cart-header .back-symbol:hover {
    color: #007BFF; /* 悬停颜色可根据需求调整 */
}

.cart-header h1 {
    font-size: 20px;
    /* 确保标题居中 */
    margin: 0 auto; 
    text-align: center;
    /* 防止标题被挤压 */
    flex-grow: 1; 
}

/* 为 user-page 头部也应用 cart-header 样式 */
.user-page .cart-header {
    background-color: #000;
}

.cart-header a img {
    width: 24px;
    height: 24px;
}

.cart-header h1 {
    font-size: 20px;
    margin: 0 auto;
}

/* 主内容区域 */
.cart-main {
    padding: 0;
    max-width: none;
    margin: 0;
}

/* 地址信息 */
.address-section {
    background-color: white;
    padding: 24px;
    border-radius: 0;
    margin-bottom: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    width: 100%;
}

.address-section h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 18px;
    font-weight: 600;
}

.address-section .address {
    font-size: 16px;
    color: #34495e;
    margin-bottom: 16px;
    line-height: 1.5;
}

.address-section .contact,
.address-section .delivery-time {
    font-size: 14px;
    color: #7f8c8d;
    margin: 12px 0;
    display: flex;
    align-items: center;
}

.address-section .contact::before,
.address-section .delivery-time::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: #7f8c8d;
    border-radius: 50%;
    margin-right: 8px;
}

.address-section hr {
    border: 0;
    height: 1px;
    background-color: #ecf0f1;
    margin: 18px 0;
}

/* 订单明细 */
.order-details {
    background-color: white;
    padding: 24px;
    border-radius: 0;
    margin-bottom: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    width: 100%;
}

.order-details h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

.order-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #ecf0f1;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    margin-right: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.order-item .item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.order-item .item-name {
    font-size: 18px;
    color: #34495e;
    margin-bottom: 8px;
    font-weight: 500;
}

.order-item .item-quantity {
    font-size: 14px;
    color: #7f8c8d;
}

.order-item .item-price {
    font-size: 18px;
    color: #e74c3c;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

/* 备注 */
.remarks-section {
    background-color: white;
    padding: 24px;
    border-radius: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    width: 100%;
}

.remarks-section h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 18px;
    font-weight: 600;
}

.remarks-section textarea {
    width: 100%;
    height: 140px;
    padding: 14px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    resize: none;
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #34495e;
    transition: border-color 0.3s ease;
}

.remarks-section textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 底部支付栏 */
.bottom-payment-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #000;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    z-index: 1000;
}

.bottom-payment-bar .left-content {
    display: flex;
    align-items: center;
}

.bottom-payment-bar .left-content img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.bottom-payment-bar .order-badge {
    background-color: #ff0000;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    margin-right: 15px;
}

.bottom-payment-bar .total-amount {
    font-size: 20px;
    font-weight: bold;
}

.bottom-payment-bar .pay-btn {
    background-color: #ffd700;
    color: #000;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
}


/* 下单成功页面样式 */
body.success-page {
    background-color: white;
}

/* 头部 */
.success-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #000;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    z-index: 1000;
}

.success-header a img {
    width: 24px;
    height: 24px;
}

.success-header h1 {
    font-size: 20px;
    margin: 0;
}

/* 主要内容区域 */
.success-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: 60px; /* 为固定头部留出空间 */
    padding-bottom: 20px;
}

/* 成功图标 */
.success-icon {
    margin-bottom: 20px;
}

.success-icon img {
    width: 120px;
    height: 120px;
}

/* 成功提示 */
.success-message {
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
}

/* 预计时间 */
.estimated-time {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

/* 状态提示 */
.status-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
}

/* 操作按钮 */
.action-button {
    background-color: #ffd700;
    color: #000;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 18px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.action-button:hover {
    background-color: #e0bf00;
}

/* 用户中心页面样式 */
.user-page {
    background-color: #f0f0f0; /* 浅灰色背景 */
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

.user-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffd700; /* 黄色背景 */
    display: flex;
    align-items: center;
    padding: 10px 20px;
    z-index: 1000;
}

.back-arrow {
    width: 24px;
    height: 24px;
    margin-right: 20px;
}

.user-header h1 {
    margin: 0;
    font-size: 18px;
}

.user-info {
    background-color: #ffd700; /* 黄色背景 */
    padding: 70px 20px 20px;
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-right: 20px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-nickname {
    font-size: 18px;
    font-weight: bold;
    display: inline-block;
    margin-right: 5px;
}

.gender-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

.user-phone {
    font-size: 14px;
    color: #333;
}

.feature-entries {
    padding: 20px;
}

.feature-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.feature-card img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    vertical-align: middle;
}

.latest-order-title {
    background-color: #f0f0f0;
    padding: 10px 20px;
    font-size: 16px;
    margin: 0;
}

.latest-order-card {
    background-color: white;
    margin: 10px 20px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.order-date {
    font-size: 14px;
}

.order-status {
    font-size: 14px;
    color: #999;
}

.dashed-line {
    border: none;
    border-top: 1px dashed #ccc;
    margin: 10px 0;
}

.order-item, .order-total {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

.item-name, .total-text {
    font-size: 14px;
}

.item-quantity, .total-amount {
    font-size: 14px;
    color: #333;
}

.logout-button {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background-color: white;
    cursor: pointer;
}

.back-symbol {
    font-size: 24px;
    color: #333; /* 颜色可根据需求调整 */
    display: inline-block;
    margin-right: 20px;
    /* 以下为添加点击反馈效果 */
    cursor: pointer;
    transition: color 0.3s ease;
}

.back-symbol:hover {
    color: #007BFF; /* 悬停颜色可根据需求调整 */
}
/* 订单列表页面样式 */
.order-list-page {
    background-color: #f0f0f0; /* 浅灰色背景 */
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

.order-list-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #333; /* 深灰色背景 */
    color: white;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    z-index: 1000;
}

.order-list-header a {
    margin-right: 20px;
}

.order-list-header .back-symbol {
    font-size: 24px;
    color: white;
    display: inline-block;
    cursor: pointer;
    transition: color 0.3s ease;
}

.order-list-header .back-symbol:hover {
    color: #007BFF;
}

.order-list-header h1 {
    font-size: 20px;
    margin: 0 auto;
    text-align: center;
    flex-grow: 1;
}

.order-list-area {
    padding: 60px 20px 80px; /* 为固定头部和底部导航留出空间 */
    max-height: calc(100vh - 140px); /* 减去头部和底部导航高度 */
    overflow-y: auto;
}

.order-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.order-date {
    font-size: 14px;
}

.order-status {
    font-size: 14px;
    color: #999;
}

.dashed-line {
    border: none;
    border-top: 1px dashed #ccc;
    margin: 10px 0;
}

.order-item, .order-total {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

.item-name, .total-text {
    font-size: 14px;
}

.item-quantity, .total-amount {
    font-size: 14px;
    color: #333;
}

.end-of-list {
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* 登录页面样式 */
.login-page {
    background-color: #f4f4f9;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
}

.login-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.login-container button {
    width: 100%;
    padding: 10px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-container button:hover {
    background-color: #0056b3;
}

.login-container p {
    text-align: center;
    margin-top: 15px;
}

.login-container a {
    color: #007BFF;
    text-decoration: none;
}

/* 注册页面样式 */
.register-page {
    background-color: #f4f4f9;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
}

.address-section {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.address-section h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.address-section .address-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.address-section .address-input:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.address-section hr {
    border: 0;
    height: 1px;
    background-color: #eee;
    margin-bottom: 15px;

}

.register-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.register-container h1 {
    text-align: center;
    margin-bottom: 20px;
}

.register-container .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.register-container button {
    width: 100%;
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.register-container button:hover {
    background-color: #218838;
}

.register-container p {
    text-align: center;
    margin-top: 15px;
}

.register-container a {
    color: #007BFF;
    text-decoration: none;
}